package com.springboot.base.common;

import lombok.Data;

public enum EmBusinessError {

    //通用错误类型10000开头
    NO_OBJECT_FOUND(10001,"找不到对象"),
    UNKNOWN_ERROR(10002,"未知错误"),
    NO_PAGE_FOUND(10003,"找不到页面"),
    BIND_ERROR(10004,"参数不正确"),
    PARAMETER_VALIDATION_ERROR(10005,"参数校验不正确"),

    //用户模块错误20000
    REGISTER_DUP_FAIL(20001,"用户已存在"),
    USER_NOT_FOUND(20002,"用户未注册"),


    //管理员错误30000开头
    ADMIN_SHOULD_LOGIN(30001,"管理员未登录"),

    ;
    private Integer code;

    private String msg;

    EmBusinessError(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
